package s.k.gui.webtest.exceptions;

import s.k.gui.webtest.basetools.SKWindow;
import junit.framework.AssertionFailedError;

public class SKFailedError extends AssertionFailedError {

	private static final long serialVersionUID = 1L;

	private Exception e;

	public SKFailedError() {

		SKWindow.closeAllWindows();

	}

	public SKFailedError(String message) {

		super(message);

		SKWindow.closeAllWindows();

		dealException();
	}

	public SKFailedError(String message, Exception e) {

		super(message);

		this.e = e;

		dealException();

	}

	public void dealException() {

		if (this.e != null) {

			this.e.printStackTrace();
		}
	}

}
